import request from "@/utils/request";

// 二级菜单 学生管理
// >  get /teacher/getCourse/teachId [courseName] list  下拉菜单
export function getCourse(teachId) {
  return request({
    url: '/teacher/getCourse/'+teachId,
    method: 'get'
  })
}

// >  get /teacher/getStudent/teachId/courseName return {student_id,name,age,sex}  获取教师
// >  [student_id,name,age,sex,courseName] list
export function getStudent(teachId,courseId ,data) {
  return request({
    url: '/teacher/getStudent/'+teachId +'/'+courseId,
    method: 'get',
    params: data
  })
}
// 二级菜单 成绩评级
// > get /student/getStudentScoreByRate/class_id/teacherId
// > {tableTop:{studentName,数学，英语....},
// > data: [[studentName,score,sscore...]...] }
export function getStudentScoreByRate(classId,teacherId) {
  return request({
    url: '/student/getStudentScoreByRate/'+classId+'/'+teacherId,
    method: 'get'
  })
}
export function getStudentRate(studentId,teachId) {
  return request({
    url: '/student/getStudentRate/'+studentId+'/'+teachId,
    method: 'get'
  })
}

export function rateStudent(data) {
  return request({
    url: '/student/rateStudent',
    method: 'post',
    data:data
  })
}

export function rateTeacherScore(data) {
  return request({
    url: '/teacherEvaluation',
    method: 'put',
    data:data
  })
}
export function rateStudentScore(data) {
  return request({
    url: '/studentEvaluation',
    method: 'put',
    data:data
  })
}

export function gradingScore(data) {
  return request({
    url: '/studentCourse',
    method: 'put',
    data:data
  })
}

